const bgm = uni.createInnerAudioContext();
// bgm.src = "https://images.szrwx.com/mjyh-images/resources/music/bgm.ogg";
bgm.loop = true; 
bgm.autoplay = true;
bgm.sessionCategory = "soloAmbient";
bgm.volume = 0.4
var music = {
	playBgm({mute=true, src=""}){
		if(!src){
			return
		}
		if(!bgm){
			return;
		}
		bgm.src=src
		if(mute){
			bgm.pause();
		}else{
			bgm.play();
		}
		
		bgm.onPause(() => { 
			console.log("暂停音乐")
		})
		bgm.onPlay(() => {
			console.log("播放音乐")
		})
		bgm.onError(() => {})
	}
}
module.exports = music